package com.hujf.flink.DataSet;

import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.java.operators.DistinctOperator;
import org.apache.flink.api.java.tuple.Tuple3;

/**
 * @Author hujf
 * @Date 2022/5/19 9:35
 * @Description TODO
 */
public class DisTinctTest {
    public static void main(String[] args) throws Exception {
        ExecutionEnvironment environment = ExecutionEnvironment.getExecutionEnvironment();

        DataSet<Tuple3<Integer, Integer, Integer>> tuple2DataSource = environment.fromElements(new Tuple3<>(1,2,3), new Tuple3<>(1, 2,3),new Tuple3<>(1,2,3));

//        DistinctOperator<Tuple3<Integer, Integer, Integer>> distinct = tuple2DataSource.distinct();
//        distinct.print();

        tuple2DataSource.distinct(new KeySelector<Tuple3<Integer, Integer, Integer>, Object>() {
            @Override
            public Object getKey(Tuple3<Integer, Integer, Integer> value) throws Exception {
                return null;
            }
        });

    }
}
